\documentclass[12pt,a4paper,twoside,openright,catalan]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{breakurl}
\usepackage{listings}
\usepackage{textcomp}
\usepackage[section]{placeins}
%\usepackage{multirow}
\usepackage[usenames,dvipsnames]{color}
\usepackage[catalan]{babel}
%\usepackage[refpages]{gloss}
\usepackage{pifont}
\usepackage{rotating}

\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\newcommand{\comments}[1]{}
\newcommand{\TODO}[1]{}
\newcommand{\FIXIT}[1]{}

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

%adding a page break before each section?

%\let\oldsection = \section
%\renewcommand{\section}[1]{
%	\pagebreak
%	\oldsection{#1}
%}

\title{Memòria del projecte}
\author{Adrià Ribatallada i Torelló}

\date{\today}

%\makegloss
%\makeindex

\begin{document}

\lstset{
  language=bash,
  keywordstyle=\color{blue}\bfseries,
  commentstyle=\color{ForestGreen},
  frame=ltrb,
  framesep=2pt,
  extendedchars=false,
  showstringspaces=false,
  breaklines=true
}

\definecolor{forestgreen}{RGB}{34,139,34}
\definecolor{orangered}{RGB}{239,134,64}
\definecolor{darkblue}{rgb}{0.0,0.0,0.6}
\definecolor{gray}{rgb}{0.4,0.4,0.4}

\lstdefinestyle{XML} {
    language=XML,
    extendedchars=true, 
    breaklines=true,
    breakatwhitespace=true,
    emph={},
    emphstyle=\color{red},
    basicstyle=\ttfamily,
    columns=fullflexible,
    commentstyle=\color{gray}\upshape,
    morestring=[b]",
    morecomment=[s]{<?}{?>},
    morecomment=[s][\color{forestgreen}]{<!--}{-->},
    keywordstyle=\color{orangered},
    stringstyle=\ttfamily\color{black}\normalfont,
    tagstyle=\color{darkblue}\bf,
    morekeywords={attribute,xmlns,version,type,release},
}

%\maketitle

\input{./MemoriaTitle.tex}

\cleardoublepage

\input{./MemoriaThank.tex}

\cleardoublepage

\tableofcontents

\cleardoublepage\thispagestyle{empty}
\cleardoublepage\thispagestyle{empty}

\newpage 
\vspace*{\fill}
\pagebreak

% *** PART ***

\chapter{Introducció}

\input{./MemoriaIntro.tex}

% *** PART ***

\cleardoublepage
\chapter{Objectius}

\input{./MemoriaObjts.tex}

% *** PART ***

\cleardoublepage
\chapter{Estudi Tecnològic}

\input{./MemoriaEstudi.tex}

% *** PART ***

\cleardoublepage
\chapter{Anàlisi i Disseny}

\input{./MemoriaEspec.tex}

% *** PART ***

\cleardoublepage
\chapter{Implementació}

\input{./MemoriaImplm.tex}

% *** PART ***

\cleardoublepage
\chapter{Planificació i estudi econòmic}

\input{./MemoriaPlanificacio.tex}

% *** PART ***

\cleardoublepage
\chapter{Conclusions i Treball Futur}

\input{./MemoriaConcl.tex}

% *** PART ***

\cleardoublepage
\appendix
\chapter{Annexos}

\input{./MemoriaAnnex.tex}

% *** PART ***

%\cleardoublepage
%\chapter{Glossari}

%\printgloss{glsbase,Memoria}

\cleardoublepage

\input{./MemoriaBibli.tex}

\end{document}
